package com.example;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;

public class MyClass {

    public static void main(String[] args){
        Schema schema = new Schema(1,"com.fanhao.dllo.soundfm.entity.greendao");

        // 轮播数据库
        Entity focusImages = schema.addEntity("FocusImages");
        focusImages.addIntProperty("id");
        focusImages.addStringProperty("shortTitle");
        focusImages.addStringProperty("pic");
        focusImages.addIntProperty("type");
        focusImages.addLongProperty("uid");
        focusImages.addLongProperty("trackId");
        focusImages.addIntProperty("albumId");
        focusImages.addBooleanProperty("isShare");

        // 小编推荐数据库
        Entity editorEntity = schema.addEntity("EditorEntity");
        editorEntity.addStringProperty("title1").columnName("titleOut");
        editorEntity.addLongProperty("albumId");
        editorEntity.addStringProperty("coverLarge");
        editorEntity.addStringProperty("title2").columnName("titleIn");
        editorEntity.addStringProperty("tags");
        editorEntity.addIntProperty("tracks");
        editorEntity.addStringProperty("playsCounts");
        editorEntity.addStringProperty("isFinished");
        editorEntity.addIntProperty("trackId");
        editorEntity.addStringProperty("trackTitle");

        // 精品听单数据库
        Entity specialEntity = schema.addEntity("SpecialEntity");
        specialEntity.addStringProperty("title1").columnName("titleOut");
        specialEntity.addIntProperty("columnType");
        specialEntity.addStringProperty("title2").columnName("titleIn");
        specialEntity.addStringProperty("subtitle");
        specialEntity.addStringProperty("footnote");
        specialEntity.addStringProperty("coverPath");
        specialEntity.addStringProperty("contentType");

        // 发现新奇数据库
        Entity discoveryEntity =schema.addEntity("DiscoveryEntity");
        discoveryEntity.addIntProperty("id");
        discoveryEntity.addStringProperty("title");
        discoveryEntity.addStringProperty("subtitle");
        discoveryEntity.addStringProperty("coverPath");
        discoveryEntity.addStringProperty("contentType");
        discoveryEntity.addStringProperty("url");
        discoveryEntity.addStringProperty("sharePic");

        // 听***数据库
        Entity hotEntity = schema.addEntity("HotEntity");
        hotEntity.addStringProperty("title1").columnName("titleOut");
        hotEntity.addStringProperty("contentType");
        hotEntity.addBooleanProperty("isFinished1").columnName("isFinishedOut");
        hotEntity.addIntProperty("categoryId");
        hotEntity.addIntProperty("count");
        hotEntity.addBooleanProperty("hasMore");
        hotEntity.addIntProperty("albumId");
        hotEntity.addStringProperty("coverLarge");
        hotEntity.addStringProperty("title2").columnName("titleIn");
        hotEntity.addStringProperty("tages");
        hotEntity.addIntProperty("tracks");
        hotEntity.addIntProperty("playsCounts");
        hotEntity.addIntProperty("isFinished");
        hotEntity.addIntProperty("serialState");
        hotEntity.addIntProperty("trackId");
        hotEntity.addIntProperty("trackTitle");


        //建表
        try {
            new DaoGenerator().generateAll(schema,"./app/src/main/java");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
